<%@ Control Language="C#" AutoEventWireup="true" CodeFile="users.ascx.cs" Inherits="forums_admin_users" %>
<%@ Register Src="ModifyUser.ascx" TagName="ModifyUser"
    TagPrefix="uc1" %>
<asp:Panel Width="100%" runat="server" ID="pnlSearch" DefaultButton="btnSearch">
    <fieldset>
        <legend>
            Search For Users:
        </legend>
        <p>
            Username: <asp:TextBox runat="server" ID="txtUsername" />
        </p>
        <p>
            <asp:Button runat="server" ID="btnSearch" Text="Search" OnClick="btnSearch_Click" />
        </p>
        
        <p>
            <asp:LinkButton runat="server" ID="btnHelp"
                Text="Search Tips" OnClick="btnHelp_Click" />
        </p>
        <asp:Panel runat="server" ID="pnlSearchTips" Visible="false" Width="100%">
            <ul>
                <li>
                    "<code>%</code>" matches zero or more characters. "Bob%" matches Bob, Bobby, Bobber, Bobcat, etc.
                </li>
                <li>
                    "<code>_</code>" matches any single character. "_unny" matches Bunny, Sunny, Runny, etc.
                </li>
                <li>
                    "<code>[<i>chars</i>]</code>" matches any characters in the charlist. "[KCS]at" matches Kat, Cat, and Sat.
                </li>
                <li>
                    "<code>[^<i>chars</i>]</code>" matches any characters not contained in the charlist. "[^KCS]at" matches Bat, Mat, Pat, etc.
                </li>
                <li>
                    Search is case sensitive. "Yah%" matches "Yahweh", but not "yahweh" or "yAhweh".
                </li>
                <li>
                    Combine wildcards for more expressive searches. "[KC]at%" matches Katrina, Cats, Catattafish, Katie, etc.
                </li>
            </ul>
        </asp:Panel>
    </fieldset>
</asp:Panel>
<asp:MultiView ID="mviewUsers" runat="server">
    <asp:View ID="viewList" runat="server">
        <asp:GridView ID="gridUsers" runat="server" AutoGenerateColumns="False" Width="100%">
            <Columns>
                <asp:TemplateField HeaderText="Username" SortExpression="Username">
                    <ItemTemplate>
                        <asp:LinkButton runat="server" ID="btnSelectUser"
                            Text='<%# Server.HtmlEncode(Eval("Username").ToString()) %>'
                            CommandArgument='<%# Eval("ID") %>'
                            OnCommand="SelectUser"/>
                    </ItemTemplate>
                    <ItemStyle Width="33%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Registration Date" SortExpression="RegistrationDate">
                    <ItemTemplate>
                        <%# DateTime.Parse(Eval("RegistrationDate").ToString()).ToString("yyyy-MM-dd hh:mm tt") %>
                    </ItemTemplate>
                    <ItemStyle Width="33%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Email" SortExpression="Email">
                    <ItemTemplate>
                        <%# Server.HtmlEncode(Eval("EmailAddress") as string) %>
                    </ItemTemplate>
                    <ItemStyle Width="33%" />
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                No users found matching criteria.
            </EmptyDataTemplate>
        </asp:GridView>
    </asp:View>
    <asp:View ID="viewUser" runat="server">
        <asp:LinkButton ID="btnBack" runat="server" OnClick="btnBack_Click">Back</asp:LinkButton><br />
        <br />
        <uc1:ModifyUser id="ModifyUser1" runat="server">
        </uc1:ModifyUser>
    </asp:View>
</asp:MultiView>